package aidlserver.app

import android.os.Parcel
import android.os.Parcelable

class BankCount() : Parcelable {
    var type: Int = 1
    var account: String = ""
    var name: String = "123456"
    var passwd: String = "liulei"

    constructor(parcel: Parcel) : this() {
        type = parcel.readInt()
        account = parcel.readString() ?: ""
        name = parcel.readString() ?: ""
        passwd = parcel.readString() ?: ""
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeInt(type)
        parcel.writeString(account)
        parcel.writeString(name)
        parcel.writeString(passwd)
    }

    override fun describeContents(): Int {
        return 0
    }

    override fun toString(): String {
        return "BankCount(type=$type, account='$account', name='$name', passwd='$passwd')"
    }

    companion object CREATOR : Parcelable.Creator<BankCount> {
        override fun createFromParcel(parcel: Parcel): BankCount {
            return BankCount(parcel)
        }

        override fun newArray(size: Int): Array<BankCount?> {
            return arrayOfNulls(size)
        }
    }
}